<?php 
/* P3(c)

******************************************************************************
                                                                                      
                         __                                                        
                        /__)                                                       
                       /__        P3 - moving Technologie            
                        __)                                                          
                        __)                                                          
                                                                                        
                                                                                        
       Copyright 2009 by p3.co.at                                                                                 
                                                                                        
       visit www.p3.co.at to get more Informations 
       about Teriko - Betriebsdatenerfassung                                                                                 
       - it's not allowed to change this scripts
       - it's not allowed to remove this copyright-tag

       -- you can download the complete license   
          under http://www.teriko.org

 (c) by Patrik Pfaffenbauer and P3 (http://www.p3.co.at)

 | Programname: P3.Teriko
 | Authtor: P3.Verein
 | Coder: Patrik Pfaffenbauer
 | Version: 0.1

 | Change Index
 |_____________________________________________
 |                                             |
 |4.3.2010 Erstellung | Patrik Pfaffenbauer    |
 |_____________________________________________|

******************************************************************************

P3(c) */

class Home extends Base
{
	public function Home()
	{
		$this->title = "Home";
		$this->toolbar = true;
		$this->allowed = true;
	}
	
	public function AnalysPost()
	{
		$this->Paint();
	}
	
	public function Paint()
	{
		
		if(!isset($_SESSION['userid']) || $_SESSION['userid'] == "")
		{
			session_destroy();
			Redirect("index.php");
		}
		include("./_tables.php");
		echo '
		<table class="adminform">
			<tr>
				<td width="55%" valign="top">
					<div id="cpanel">';
		
		$member = new Member();
		if($member->allowed)
			AddContentLink("index.php?s=member", "images/header/icon-48-user.png", $GLOBALS['lang']->GetLanguage("Member", "title"));
		
		$customer = new Customer();
		if($customer->allowed)
			AddContentLink("index.php?s=customer", "images/header/icon-48-customer.png", $GLOBALS['lang']->GetLanguage("Customer", "title"));	
			
		$permission = new Permission();
		if($permission->allowed)
			AddContentLink("index.php?s=permission", "images/header/icon-48-permission.png", $GLOBALS['lang']->GetLanguage("Permission", "title"));
		
		$country = new Country();
		if($country->allowed)
			AddContentLink("index.php?s=country", "images/header/icon-48-language.png", $GLOBALS['lang']->GetLanguage("Country", "title"));
			
		$lang = new Language();
		if($lang->allowed)
			AddContentLink("index.php?s=language", "images/header/icon-48-language.png", $GLOBALS['lang']->GetLanguage("Language", "title"));

		$pause = new Pause();
		if($pause->allowed)
			AddContentLink("index.php?s=pause", "images/header/icon-48-pause.png", $GLOBALS['lang']->GetLanguage("Pause", "title"));
			
		$homenews = new Homenews();
			if($homenews->allowed)
			AddContentLink("index.php?s=homenews", "images/header/icon-48-content.png",$GLOBALS['lang']->GetLanguage("Homenews", "title"));
			
		$proj = new Project();
		if($proj->allowed)
			AddContentLink("index.php?s=project", "images/header/icon-48-project.png", $GLOBALS['lang']->GetLanguage("Project", "title"));

		$task = new Task();
		if($task->allowed)
			AddContentLink("index.php?s=task", "images/header/icon-48-article.png", $GLOBALS['lang']->GetLanguage("Task", "title"));	
		
		$online = new Online();
		if($online->allowed)
			AddContentLink("index.php?s=online", "images/header/icon-48-online.png", $GLOBALS['lang']->GetLanguage("Online", "title"));

		$offline = new Offline();
		if($offline->allowed)
			AddContentLink("index.php?s=offline", "images/header/icon-48-offline.png", $GLOBALS['lang']->GetLanguage("Offline", "title"));
		
		echo '	</div>
			</td>
			<td width="45%" valign="top">
		';
		
		$query = $GLOBALS['db']->Query("SELECT * FROM ".$tblhomenews." order by date desc");
		
		while($line = $GLOBALS['db']->Fetch($query))
		{
			if($line->id == "1")
				AddContentMessage($line->header.", ". $_SESSION['firstName']." ".$_SESSION['lastName'], $line->text);
			else
				AddContentMessage($line->header, $line->text);
		}
		
		echo '
				</td>
			</tr>
		</table>';
	}
	
	public function Toolbar()
	{
		
	}
	
	public function AddCSS()
	{
			echo '<link rel="stylesheet" type="text/css" href="css/SqueezeBox/squeeze.css" /> ';
	}
	public function AddJS()
	{
		echo '
		<script type="text/javascript">
			window.addEvent(\'domready\', function(){
				new Accordion($$(\'.panel h3.jpane-toggler\'), $$(\'.panel div.jpane-slider\'), {onActive: function(toggler, i) { toggler.addClass(\'jpane-toggler-down\'); toggler.removeClass(\'jpane-toggler\'); },onBackground: function(toggler, i) { toggler.addClass(\'jpane-toggler\'); toggler.removeClass(\'jpane-toggler-down\'); },duration: 300,opacity: false,alwaysHide: true}); 
			});
		</script>';
		
		echo '<script type="text/javascript">
		
		window.addEvent(\'domready\', function() {

			SqueezeBox.initialize({});
			SqueezeBox.assign($$(\'a.modal\'), {
				parse: \'rel\'
			});
		});
		
		</script>';
	}
}

?>